//
//  AreaViewController.m
//  Calculation
//
//  Created by niit on 16/2/22.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "AreaViewController.h"

@interface AreaViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textlong;
@property (weak, nonatomic) IBOutlet UITextField *textwidth;
@property (weak, nonatomic) IBOutlet UITextField *area1;
@property (weak, nonatomic) IBOutlet UITextField *textr;
@property (weak, nonatomic) IBOutlet UITextField *area2;

@end

@implementation AreaViewController
- (IBAction)areapress:(id)sender
{
    NSString *result1=[NSString stringWithFormat:@"%i",[self.textlong.text intValue]*[self.textwidth.text intValue]];
    self.area1.text=result1;
    
    NSString *result2=[[NSString alloc] initWithFormat:@"%f",3.14*[self.textr.text intValue]*[self.textr.text intValue]];
    
    self.area2.text=result2;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
